package com.charging.system.service.impl;

import java.util.List;
import com.charging.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.charging.system.mapper.KxRefundRecordMapper;
import com.charging.system.domain.KxRefundRecord;
import com.charging.system.service.IKxRefundRecordService;

/**
 * 退款记录Service业务层处理
 *
 * @author charging
 * @date 2024-04-19
 */
@Service
public class KxRefundRecordServiceImpl implements IKxRefundRecordService
{
    @Autowired
    private KxRefundRecordMapper kxRefundRecordMapper;

    /**
     * 查询退款记录
     *
     * @param refundRecordId 退款记录主键
     * @return 退款记录
     */
    @Override
    public KxRefundRecord selectKxRefundRecordByRefundRecordId(Long refundRecordId)
    {
        return kxRefundRecordMapper.selectKxRefundRecordByRefundRecordId(refundRecordId);
    }

    /**
     * 查询退款记录列表
     *
     * @param kxRefundRecord 退款记录
     * @return 退款记录
     */
    @Override
    public List<KxRefundRecord> selectKxRefundRecordList(KxRefundRecord kxRefundRecord)
    {
        return kxRefundRecordMapper.selectKxRefundRecordList(kxRefundRecord);
    }

    /**
     * 新增退款记录
     *
     * @param kxRefundRecord 退款记录
     * @return 结果
     */
    @Override
    public int insertKxRefundRecord(KxRefundRecord kxRefundRecord)
    {
        kxRefundRecord.setCreateTime(DateUtils.getNowDate());
        return kxRefundRecordMapper.insertKxRefundRecord(kxRefundRecord);
    }

    /**
     * 修改退款记录
     *
     * @param kxRefundRecord 退款记录
     * @return 结果
     */
    @Override
    public int updateKxRefundRecord(KxRefundRecord kxRefundRecord)
    {
        kxRefundRecord.setUpdateTime(DateUtils.getNowDate());
        return kxRefundRecordMapper.updateKxRefundRecord(kxRefundRecord);
    }

    /**
     * 批量删除退款记录
     *
     * @param refundRecordIds 需要删除的退款记录主键
     * @return 结果
     */
    @Override
    public int deleteKxRefundRecordByRefundRecordIds(Long[] refundRecordIds)
    {
        return kxRefundRecordMapper.deleteKxRefundRecordByRefundRecordIds(refundRecordIds);
    }

    /**
     * 删除退款记录信息
     *
     * @param refundRecordId 退款记录主键
     * @return 结果
     */
    @Override
    public int deleteKxRefundRecordByRefundRecordId(Long refundRecordId)
    {
        return kxRefundRecordMapper.deleteKxRefundRecordByRefundRecordId(refundRecordId);
    }
}
